<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function main() {
				var g =prompt("请输入一个正整数：", '');
				if((isNaN(g))||(parseInt(g)<=0)||(parseFloat(g)%1!=0)||(g.indexOf(0)=="0")) {
					document.write("不是数字或不是正整数或第一位为0不符合条件");
				} else {
					var num=parseInt(g);
					for(;;){
						if(num<10&&num>0){
							document.write("最高位是："+parseInt(num));
							break;
						}
						num=num/10;
					}
			}
				}
				main();
		</script>
	</head>
	<body>
		
	</body>
</html>
